package com.bw.ad1;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bw.MyKafkaUtil;
import com.bw.bean.OrgSort;
import org.apache.flink.api.common.eventtime.SerializableTimestampAssigner;
import org.apache.flink.api.common.eventtime.WatermarkStrategy;
import org.apache.flink.api.common.functions.FilterFunction;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.state.*;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
import org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction;
import org.apache.flink.streaming.api.windowing.assigners.TumblingEventTimeWindows;
import org.apache.flink.streaming.api.windowing.time.Time;
import org.apache.flink.streaming.api.windowing.windows.TimeWindow;
import org.apache.flink.util.Collector;

import java.util.ArrayList;
import java.util.Iterator;

public class Test13 {
    public static void main(String[] args) throws Exception {


        /**
         * 1、读取order_info 表
         * 2、过滤下单和完成的数据  下单10
         * 3、先根据订单分组，把下单时间放到状态里面，等到达数据  orderID  达到100   这个订单花了90分钟
         * 4、根据发送省份和到达省份分组  北京-上海
         * 5、 订单1 100   订单2 200   订单3 300
         * 6、求平均  北京-上海 平均到达  200
         * 7、把北京-上海的订单存在数据库中
         * 又一个订单 北京-上海  从数据库差    预计到达 200
         */
    }
}
